import { useTable, LIST_TYPE } from '@crud/index';
import { activityList } from '@/api/crm-kgj/activity';
/** 活动状态 */
export const activityStatusMaps: any = {
  1: '上架中',
  2: '已下架',
  3: '未开始',
  4: '已结束'
};

export const useTableListActivity = (options: any = {}) => {
  const columns = [
    { label: 'Banner', prop: 'main_banner_url', render: 'main_banner_url', align: 'center', width: 186 },
    { label: '活动标题', prop: 'title', align: 'center', minWidth: 250 },
    { label: '关联活动信息ID', prop: 'activity_id', render: 'activity_id', align: 'center', width: 150 },
    { label: '活动时间', prop: 'time', render: 'time', align: 'center', minWidth: 210 },
    { label: '优先级', prop: 'priority', align: 'center', width: 122 },
    { label: '活动状态', prop: 'status', render: 'status', align: 'center', width: 122 },
    { label: '操作', prop: 'actions', render: 'actions', minWidth: 120, align: 'center' }
  ];

  return useTable({
    ...options,
    type: LIST_TYPE.KGJ,
    columns,
    params: {
      platform: 2 // 1-web  2-app
    },
    getList: activityList
  });
};

